<template>
	<div class="shopapply">
		<ul class="applyxinxi-list">
			<li>
				<h4>特色馆名称*</h4>
				<input type="text" placeholder="请输入店铺名称" v-model="store_name"/>
			</li>
			<li>
				<h4>店铺运营者*</h4>
				<input type="text" placeholder="请输入店铺运营者" v-model="owner_name"/>
			</li>
			<li>
				<h4>运营者职位*</h4>
				<input type="text" placeholder="请输入职位" v-model="yunyingzhezhiwei"/>
			</li>
			<li>
				<h4>运营者联系电话*</h4>
				<input type="number" placeholder="请输入联系方式" v-model="tel"/>
			</li>
			<li>
				<h4>运营者联系邮箱*</h4>
				<input type="email" placeholder="请输入联系邮箱*" v-model="yunyingzheyouxiang"/>
			</li>
		</ul>
		<div class="apply-requery">
			<span v-show="tongstatus" @click="tongstatus=!tongstatus"><img src="../../img-address/icon_select @3x.png"/></span>
			<span v-show="!tongstatus" @click="tongstatus=!tongstatus"><img src="../../img-address/icon_dis@3x.png"/></span>
			<p>我已认真阅读并完全同意<a href="http://www.ntyouxuan.com/index.php?app=apply">开店协议</a>中的所有条款</p>
		</div>
		<div class="apply-sendbtn" @click="applysend()">下一步</div>
	</div>
</template>

<script>
	export default{
		name:'shopapply',
		data(){
			return{
				tongstatus:false,
				user:0,
				store_name:'',
				owner_name:'',
				yunyingzhezhiwei:'',
				tel:'',
				yunyingzheyouxiang:''
			}
		},
		methods:{
			jcxinxi:function(user){
				var self=this;
				$.ajax({
					type:"post",
					url:furl+"index.php?app=ajax_apply&act=index",
					data:{"token":user,"step":'2'},
					dataType:'json',
					success:function(data){
						if(data.done){
							if(data.retval.store_status==1||data.retval.store_status==2){
								console.log(111);
								self.$router.push({path:'/user'});
							}
							self.store_name=data.retval.store_name;
							self.owner_name=data.retval.owner_name;
							self.yunyingzhezhiwei=data.retval.yunyingzhezhiwei;
							self.tel=data.retval.tel;
							self.yunyingzheyouxiang=data.retval.yunyingzheyouxiang;
						}
					}
				});
			},
			applysend:function(){
				var self=this;
				if(self.store_name&&self.owner_name&&self.yunyingzhezhiwei&&self.tel&&self.yunyingzheyouxiang){
					if(self.tongstatus){
						$.ajax({
							type:"post",
							url:furl+"index.php?app=ajax_apply&act=index_post",
							data:{"token":self.user,"step":'2',"store_name":self.store_name,"owner_name":self.owner_name,"yunyingzhezhiwei":self.yunyingzhezhiwei,"tel":self.tel,"yunyingzheyouxiang":self.yunyingzheyouxiang},
							dataType:'json',
							success:function(res){
								if(res.done){
									self.$router.push({path:'/business/businessx'});
								}
							}
						})
						
					}else{
						alert("需要同意开店协议");
					}
					
				}else{
					alert("请把信息填写完整在提交");
				}
				
			}
		},
		created:function(){
			this.user=localStorage.getItem("nt_user");
		},
		mounted:function(){
			this.jcxinxi(this.user);
		}
	}
</script>

<style>
	.shopapply{font-size:0;}
	.applyxinxi-list{padding-left: 0.32rem;padding-right: 0.32rem;background-color:#fff;}
	.applyxinxi-list>li{border-bottom: 1px solid #eee;padding-top: 0.16rem;padding-bottom: 0.24rem;;}
	.applyxinxi-list>li:last-child{border:0px solid #eee;}
	.applyxinxi-list>li>h4{font-size:0.28rem;color:#fb9722;line-height: 0.58rem;}
	.applyxinxi-list>li>input{height:0.64rem;width:100%;font-size:0.32rem;color:#2B2B2B;}
	.apply-requery{padding-left: 0.32rem;margin-bottom: 0.22rem;}
	.apply-requery>span{display: inline-block;float:left;margin-right: 0.1rem;margin-top: 0.28rem;}
	.apply-requery>span>img{width:0.3rem;height:0.3rem;}
	.apply-requery>p{font-size:0.24rem;color:#999;line-height: 0.98rem;}
	.apply-requery>p>a{font-size:0.24rem;color:#fb9722;text-decoration: underline;}
	.apply-sendbtn{width:6.86rem;height:1rem;border-radius:1rem;line-height: 1rem;box-sizing: border-box;
	background: -webkit-linear-gradient(left, #ffb661 , #fb9722); 
    background: -o-linear-gradient(right, #ffb661, #fb9722); 
    background: -moz-linear-gradient(right, #ffb661, #fb9722);
    background: linear-gradient(to right, #ffb661 , #fb9722);
	text-align: center;color:#fff;font-size:0.36rem;letter-spacing: 0.1rem;padding-left: 0.3rem;margin:0 auto;}
</style>













































